package com.cloud.pole.feign;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.cloud.pole.api.permission.PermissionApi;
import com.cloud.pole.common.configuration.FeignConfiguration;
import com.cloud.pole.common.constant.ApiConstant;
import com.cloud.pole.fallback.UserServiceFallback;

import java.util.List;


/**
 * ${DESCRIPTION}
 *
 * @author wanghaobin
 * @create 2017-06-21 8:11
 */
@FeignClient(value = ApiConstant.ADMIN_SERVICE_ID, fallback = UserServiceFallback.class)
public interface IAdminUserService {
	
  @RequestMapping(value="/api/user/un/{username}/permissions",method = RequestMethod.GET)
  public List<PermissionApi> getPermissionByUsername(@PathVariable("username") String username);
  
  @RequestMapping(value="/api/permissions",method = RequestMethod.GET)
  public List<PermissionApi> getAllPermissionInfo();
  
  @RequestMapping(value="/api/user/validate",method = RequestMethod.GET)
  public boolean validate(@RequestParam("token") String token);
  
}
